package view;

import java.awt.EventQueue;

import javax.swing.JInternalFrame;
import javax.swing.ImageIcon;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JScrollPane;
import javax.swing.JPanel;
import javax.swing.border.TitledBorder;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.JButton;
import javax.swing.JTable;
import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.UIManager;

public class ContactsView extends JInternalFrame {
	private JTable table;
	private JButton btnNouveau;
	private JButton btnModifier;
	private JButton btnSupprimer;
	private JTextField tbNom;
	private JTextField tbPrenom;
	private JTextField tbPhone;
	private JTextField tbEmail;
	private JTextField tbTwitter;



	/**
	 * Create the frame.
	 */
	public ContactsView() {
		setTitle("Contacts");
		setFrameIcon(new ImageIcon(ContactsView.class.getResource("/ressources/People.png")));
		setMaximizable(true);
		setClosable(true);
		setBounds(100, 100, 662, 473);
		
		JScrollPane scrollPane = new JScrollPane();
		GroupLayout groupLayout = new GroupLayout(getContentPane());
		groupLayout.setHorizontalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(10)
					.addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 636, GroupLayout.PREFERRED_SIZE))
		);
		groupLayout.setVerticalGroup(
			groupLayout.createParallelGroup(Alignment.LEADING)
				.addGroup(groupLayout.createSequentialGroup()
					.addGap(11)
					.addComponent(scrollPane, GroupLayout.PREFERRED_SIZE, 433, GroupLayout.PREFERRED_SIZE))
		);
		
		JPanel MainPanel = new JPanel();
		scrollPane.setViewportView(MainPanel);
		
		JPanel InformationsPanel = new JPanel();
		InformationsPanel.setBorder(new TitledBorder(null, "Informations", TitledBorder.LEADING, TitledBorder.TOP, null, null));
		
		JPanel BouttonsPanel = new JPanel();
		
		JScrollPane scrollPane_1 = new JScrollPane();
		GroupLayout gl_MainPanel = new GroupLayout(MainPanel);
		gl_MainPanel.setHorizontalGroup(
			gl_MainPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_MainPanel.createSequentialGroup()
					.addGroup(gl_MainPanel.createParallelGroup(Alignment.LEADING)
						.addComponent(BouttonsPanel, GroupLayout.PREFERRED_SIZE, 624, GroupLayout.PREFERRED_SIZE)
						.addGroup(gl_MainPanel.createSequentialGroup()
							.addContainerGap()
							.addComponent(scrollPane_1, GroupLayout.DEFAULT_SIZE, 630, Short.MAX_VALUE))
						.addComponent(InformationsPanel, GroupLayout.PREFERRED_SIZE, 630, GroupLayout.PREFERRED_SIZE))
					.addContainerGap())
		);
		gl_MainPanel.setVerticalGroup(
			gl_MainPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_MainPanel.createSequentialGroup()
					.addComponent(InformationsPanel, GroupLayout.PREFERRED_SIZE, 222, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.RELATED)
					.addComponent(BouttonsPanel, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(scrollPane_1, GroupLayout.DEFAULT_SIZE, 223, Short.MAX_VALUE)
					.addContainerGap())
		);
		
		table = new JTable();
		scrollPane_1.setColumnHeaderView(table);
		
		JLabel lblNom = new JLabel("*Nom");
		
		JLabel lblPrenom = new JLabel("*Prenom");
		
		JLabel lblTelephone = new JLabel("Telephone");
		
		JLabel lblEmail = new JLabel("*Email");
		
		JLabel lblTwitter = new JLabel("Twitter");
		
		tbNom = new JTextField();
		tbNom.setColumns(10);
		
		tbPrenom = new JTextField();
		tbPrenom.setColumns(10);
		
		tbPhone = new JTextField();
		tbPhone.setColumns(10);
		
		tbEmail = new JTextField();
		tbEmail.setColumns(10);
		
		tbTwitter = new JTextField();
		tbTwitter.setColumns(10);
		
		JLabel lblchampsObligatoires = new JLabel("*Champs Obligatoires");
		lblchampsObligatoires.setForeground(UIManager.getColor("ToolBar.dockingForeground"));
		
		JLabel lblRName = new JLabel("");
		
		JLabel lblRPrenom = new JLabel("");
		
		JLabel lblREmail = new JLabel("");
		GroupLayout gl_InformationsPanel = new GroupLayout(InformationsPanel);
		gl_InformationsPanel.setHorizontalGroup(
			gl_InformationsPanel.createParallelGroup(Alignment.TRAILING)
				.addGroup(gl_InformationsPanel.createSequentialGroup()
					.addGap(94)
					.addGroup(gl_InformationsPanel.createParallelGroup(Alignment.LEADING)
						.addComponent(lblPrenom, Alignment.TRAILING)
						.addComponent(lblNom, Alignment.TRAILING)
						.addGroup(Alignment.TRAILING, gl_InformationsPanel.createParallelGroup(Alignment.LEADING)
							.addComponent(lblTwitter)
							.addComponent(lblEmail))
						.addComponent(lblTelephone, GroupLayout.DEFAULT_SIZE, 64, Short.MAX_VALUE))
					.addPreferredGap(ComponentPlacement.RELATED)
					.addGroup(gl_InformationsPanel.createParallelGroup(Alignment.LEADING)
						.addComponent(lblchampsObligatoires)
						.addGroup(gl_InformationsPanel.createSequentialGroup()
							.addGroup(gl_InformationsPanel.createParallelGroup(Alignment.LEADING, false)
								.addComponent(tbPrenom)
								.addComponent(tbNom, GroupLayout.DEFAULT_SIZE, 261, Short.MAX_VALUE))
							.addPreferredGap(ComponentPlacement.UNRELATED)
							.addGroup(gl_InformationsPanel.createParallelGroup(Alignment.LEADING)
								.addComponent(lblRPrenom)
								.addComponent(lblRName)))
						.addGroup(gl_InformationsPanel.createParallelGroup(Alignment.LEADING, false)
							.addComponent(tbTwitter)
							.addGroup(gl_InformationsPanel.createSequentialGroup()
								.addComponent(tbEmail)
								.addPreferredGap(ComponentPlacement.RELATED)
								.addComponent(lblREmail)
								.addPreferredGap(ComponentPlacement.RELATED))
							.addComponent(tbPhone, GroupLayout.DEFAULT_SIZE, 136, Short.MAX_VALUE)))
					.addGap(231))
		);
		gl_InformationsPanel.setVerticalGroup(
			gl_InformationsPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_InformationsPanel.createSequentialGroup()
					.addGroup(gl_InformationsPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblNom)
						.addComponent(tbNom, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblRName))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(gl_InformationsPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(lblPrenom)
						.addComponent(tbPrenom, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblRPrenom))
					.addGap(18)
					.addGroup(gl_InformationsPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(tbPhone, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblTelephone))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(gl_InformationsPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(tbEmail, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblEmail)
						.addComponent(lblREmail))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addGroup(gl_InformationsPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(tbTwitter, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
						.addComponent(lblTwitter))
					.addPreferredGap(ComponentPlacement.UNRELATED)
					.addComponent(lblchampsObligatoires)
					.addContainerGap(19, Short.MAX_VALUE))
		);
		InformationsPanel.setLayout(gl_InformationsPanel);
		
		btnNouveau = new JButton("Nouveau");
		btnNouveau.setIcon(new ImageIcon(ContactsView.class.getResource("/ressources/New document.png")));
		
		btnModifier = new JButton("Modifier");
		btnModifier.setIcon(new ImageIcon(ContactsView.class.getResource("/ressources/Modify.png")));
		
		btnSupprimer = new JButton("Supprimer");
		btnSupprimer.setIcon(new ImageIcon(ContactsView.class.getResource("/ressources/Erase.png")));
		GroupLayout gl_BouttonsPanel = new GroupLayout(BouttonsPanel);
		gl_BouttonsPanel.setHorizontalGroup(
			gl_BouttonsPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_BouttonsPanel.createSequentialGroup()
					.addContainerGap()
					.addComponent(btnNouveau)
					.addGap(42)
					.addComponent(btnModifier, GroupLayout.PREFERRED_SIZE, 110, GroupLayout.PREFERRED_SIZE)
					.addGap(33)
					.addComponent(btnSupprimer)
					.addContainerGap(237, Short.MAX_VALUE))
		);
		gl_BouttonsPanel.setVerticalGroup(
			gl_BouttonsPanel.createParallelGroup(Alignment.LEADING)
				.addGroup(gl_BouttonsPanel.createSequentialGroup()
					.addGroup(gl_BouttonsPanel.createParallelGroup(Alignment.BASELINE)
						.addComponent(btnNouveau)
						.addComponent(btnModifier, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
						.addComponent(btnSupprimer))
					.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
		);
		BouttonsPanel.setLayout(gl_BouttonsPanel);
		MainPanel.setLayout(gl_MainPanel);
		getContentPane().setLayout(groupLayout);

	}

	private void InitComponents(){
		
	}
	
	private void CreateComponents(){
		
		
	}
}
